package thomas.bier.client;


import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class LoginBarGUI {
	private BeerDelegate bDelegate = new BeerDelegate();
	public VerticalPanel ShowGUI () {
		HorizontalPanel hp = new HorizontalPanel();
		Label loginLabel = new Label("Gebruikersnaam:");
		hp.add(loginLabel);
		final TextBox tb = new TextBox();
		hp.add(tb);
		Label wwLabel = new Label("Wachtwoord:");
		hp.add(wwLabel);
		final PasswordTextBox ww = new PasswordTextBox();
		hp.add(ww);
		Button loginButton = new Button("Login");
		hp.add(loginButton);
		loginButton.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				bDelegate.login(tb.getText(), ww.getText());
			}

		});
		Button registreer = new Button("Registreer!");
		hp.add(registreer);
		final VerticalPanel vp = new VerticalPanel();
		registreer.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				bDelegate.registerShow();
			}
		});

		vp.add(hp);
		return vp;
	}

}



